Generally, the result of using a one-pass compiler is object code that executes much less efficiently than it might if more effort were expended in its compilation. Therefore, it is desirable to optimize object code.
In an article entitled “rePlay: A Hardware Framework for Dynamic Program Optimization”, CRHC Technical Report Draft, December 1999, by Sanjay J. Patel and Steven S. Lumetta, an optimization technique named “rePlay” is disclosed. However, rePlay relies mainly on hardware to form regions and optimize the regions at runtime. This reliance on hardware can be unrealistic since many optimizations can be complicated and require significant hardware and software compilation time.
Other optimization techniques, including partial redundancy elimination (PRE) and partial dead-code elimination (PDE), can also sometimes be ineffective and are quite complex to implement. PDE is disclosed in “Path profile guided partial dead code elimination using predication”, Parallel Architectures and Compilation Techniques, 1997, by Rajiv Gupta, David E. Benson, and Jesse Z. Fang.
Further, an optimization technique called “Superblock” is disclosed in “The Superblock: An Effective Technique for VLIW and Superscalar Compilation”, The Journal of Supercomputing, Kluwer Academic Publishers, 1993, pp. 229-248, by Wen-mei W. Hwu et al. Data and control flow for optimization and scheduling are generally simplified in a superblock. However, a superblock is still a multiple exit region. Thus, the optimization and scheduling need to handle issues such as side exit and speculation.